<%@page import="com.is.control.HomeworkControl"%>
<%@page import="com.is.util.DesData"%>
<%@page import="com.is.control.AttendanceDetailControl"%>
<%@page import="com.is.control.ParamClassControl"%>
<%@page import="com.is.model.ParamStuyear"%>
<%@page import="com.is.control.ParamStuyearControl"%>
<%@page import="com.is.control.CourseClassControl"%>
<%@page import="com.is.model.CourseClass"%>
<%@page import="java.util.List"%>
<%@page import="com.is.control.StudentControl"%>
<%@page import="com.is.model.Student"%>
<%@page import="com.is.util.ParamUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.control.ParamCourseControl"%>
<%@page import="com.is.control.CourseScoreControl"%>
<%@page import="com.is.model.CourseScore"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>个人成绩情况</title>
</head>
<body>
<%
         // 单个学生所有课程出席情况
         DesData des = new DesData();
        String stu=ParamUtil.getString(request,"stuId");
         int stuId = Integer.parseInt(des.decrypt(stu));
         //System.out.print("DDD"+stuId+"DDDD");
         Student s = StudentControl.getStudent(stuId);
         int classId = Integer.parseInt(s.getClassId());
         int stuyear = ParamUtil.getInt(request,"stuyear",ParamStuyearControl.getCurrentStuyearId());
         List<CourseClass> ccs = CourseClassControl.getAllCourseClassIdByClassIdAndStuyear(classId,stuyear);
         
 %>
<%=s.getChineseName() %>的成绩情况：
 
 <form action="allCoursesOneStu.jsp" method="post">
 <label><select name="stuyear">
 <%
         List<ParamStuyear> years = ParamStuyearControl.getAllStuyear();
         for(ParamStuyear ps:years){
 %>
 <option value="<%=ps.getId() %>"><%=ps.getStuyear() %></option>
 <%} %>
 </select>
 <input type="hidden" value="<%=stu %>" name=stuId></label>
 <label><input type="submit" value="确认" /></label>
 </form>
 <form>
 <table>
 <tr>
 <td>课程</td>
 <td>平时成绩</td>
 <td>期中成绩</td>
 <td>期末成绩</td>
 <td>总成绩</td>
 </tr>
 <%
         for(CourseClass cc:ccs){
        	 CourseScore cs =  CourseScoreControl.getCSByStuIdAndCourseId(cc.getId(),stuId);
 %>
 <tr>
 <td><%=ParamCourseControl.getCourseById(cc.getCourseId()).getCourseName() %></td>
 <td><%=cs.getDailyScore() %></td>
 <td><%=cs.getMidtermScore() %></td>
 <td><%=cs.getFinalScore() %></td>
 <td><%=cs.getTotalScore() %></td>
 </tr>
 <%} %>
 </table>
 </form>
</body>
</html>